package com.hq.fxh.Utils;

import android.app.Activity;
import android.content.Context;
import android.view.Gravity;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.hq.fxh.R;
import com.hq.fxh.CustomerView.PopupForComment;


/**
 * /**
 *
 * @author 薛
 * @ClassName
 * @Description :
 * @Created 2017/8/16
 * @Email xlwenhao1858@sina.com
 */


public class ClickUtils {
    private static PopupForComment customPopupForComment;

    public static boolean clickZhan(Context context, ImageView imageView, TextView textView,Boolean status) {
         if(!status){
            imageView.setImageResource(R.mipmap.tu_zan_to);
            textView.setTextColor(context.getResources().getColor(R.color.red));
             return true;
        }else {
            imageView.setImageResource(R.mipmap.tu_zan);
            textView.setTextColor(context.getResources().getColor(R.color.grey));
             return false;
        }
     }
    public static void clickComment(final Activity mActivity, View view ){

            customPopupForComment = new  PopupForComment(mActivity, new  PopupForComment.CommentCallBack() {
                @Override
                public void call(String comment) {

                /*    commentData = comment;
                    sentComment(comment);*/
                }
            });

        customPopupForComment.openKeyboard();
        Tool.setAlpha(mActivity, 0.6f);
        customPopupForComment.showAtLocation(view,
                Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL, 0, 0);
    }

    public static boolean clickShouChang(Context context, ImageView imageView ,boolean status) {
        if(!status){
            imageView.setImageResource(R.mipmap.tu_shoucang_to);
            LogUtils.startToash(context,"收藏成功");
            return true;
        }else {
            imageView.setImageResource(R.mipmap.tu_shoucang);
            LogUtils.startToash(context,"取消收藏成功");
            return false;

        }

     }

}
